// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import Tool from "../../lib/common/Tool";

export default class ToolExt extends Tool {

    public static indexToRow(index:number, maxCol:number) {
        return Math.floor(index/maxCol);
    }

    public static indexToCol(index:number, maxCol:number) {
        return index%maxCol;
    }

    public static rowColToIndex(row:number, col:number, maxCol:number) {
        return row*maxCol+col;
    }
}
